-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch dev server + prod build to vite! #1535
Conversation
Co-authored-by: Elijah Vennebush <[email protected]> Co-authored-by: Alex <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well on my machine! I'll wait to make sure it works on others as well, but mine is probably the oldest and slowest we're going to be using. The only issues I noticed were A. it's just very slow for some reason, and B. the icon doesn't load, although that doesn't really matter.
Works also on Pigmice's Lenovos (at least the one I'm typing this from, but the two are largely identical). Tested the login form and videos and nothing went wrong. I realized that I didn't try doing the production version on my home computer, so I'll try that soon. I'll leave it to @ev118 to approve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good!
* Get vite to mostly work Co-authored-by: Elijah Vennebush <[email protected]> Co-authored-by: Alex <[email protected]> * Fix postcss config and delete more unused * Fix tests * Remove unused babel plugins * Adjust rollup config * Fix Service Worker and PWA stuff * Update to type:module in package.json * Undo needless change src -> @ * Undo more needless changes? * For now, undo linaria changes in all files * Remove unrelated change * Undo more changes * Remove more deps (will have to add back some of these) * Dep updates since last time I worked on this * Set up new version of linaria * Fix a silly CSS bug * Use port 2733 for preview as well * Fix TS imports * Increase min chunk size for chunk merging * Remove unmaintained postcss-font-magician * Update node LTS minimum * Replace Jest with Vitest for less config * Downgrade TS to avoid needing to update eslint-plugin-caleb in this PR * Remove unused old rollup config * Undo upgrading preact to avoid needing to fix type stuff in this PR * Re-update preact to fix integration with vite and prefresh * Fix chart where polished lib was included at runtime * Fix type errors * Use node 18 in CI * Delete commented code * Run prettier on html files too --------- Co-authored-by: Elijah Vennebush <[email protected]> Co-authored-by: Alex <[email protected]>
Wheeee!
Finally got this working! The first time I tried to switch this project over to vite was in 2019 when vite was first published. About every year since then, I've come back to this trying to get it to work but there have always been roadblocks (ehem, Linaria, Jest, ESM support...). Last year I got pretty close but now I had some time to finally get it across the finish line!
Before, we were using Webpack 4 (very old) for the dev server and Rollup for the production build. Now, we are using Vite for both (well, Vite uses Rollup under the hood for the build).
Sorry, this is a big PR, but it had to be. I didn't see any way to incrementally migrate the build system over.
Testing:
npm install
npm run dev
npm install
npm run build
npm run preview
to startup a preview server of the production-built app